package com.accgm.api.main;

import org.restlet.Application;
import org.restlet.Restlet;
import org.restlet.data.LocalReference;
import org.restlet.data.Protocol;
import org.restlet.resource.Directory;

import com.accgm.api.utils.ConfigReadUtils;

public class StaticResourceApplication extends Application {
	public static String ROOT_URI = "";  
	
	static{
		ROOT_URI=(ConfigReadUtils.loadConfigByConfDir("qinqinconfig.properties").getProperty("root_path"));;
	}
	
//	public static final String ROOT_URI = "file:///data/qinqin_api/static/";  
	  /** 
     * Constructor. 
     */  
    public StaticResourceApplication() {  
        // Sets the facultative name of the application.  
        setName("Static Resource Application");  
        // the application requires the following client connector.  
//        getConnectorService().getClientProtocols().add(Protocol.CLAP);  
//        getConnectorService().getServerProtocols().add(Protocol.CLAP);  
    }  
    

    
    @Override
	public Restlet createInboundRoot() {
    	return new Directory(getContext(), ROOT_URI);  
	}
    
}  